<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

	<p:growl id="msgs" showDetail="true" />

	<p:panel header="Yeni aygıt ekle" style="margin-bottom:10px;">
		<h:panelGrid columns="2" cellpadding="5">
					
			<h:outputLabel value="Şirket : " />
			<p:selectOneMenu id="firma" value="#{SirketprofilBean.selectedSirket}"
					converter="SirketConverter">
				<f:selectItem itemLabel="Select City" itemValue="" />
				<f:selectItems value="#{SirketprofilBean.sirketproList}" 
					var="firma" itemLabel="#{firma.firmaAd}" itemValue="#{firma}"/>
				<p:ajax update="aygitList" listener="#{MusteriAygitlariBean.handleSirketChange}" />
			</p:selectOneMenu>
								
			<h:outputLabel value="Aygıt : " />
			<p:selectOneMenu id="aygitList" value="#{AygitBean.selectedAygit}" 
					converter="AygitConverter" var="a">
				<f:selectItem itemLabel="Select Product" itemValue="" />
				<f:selectItems value="#{AygitBean.aygitList}" 
					var="aygit" itemLabel="#{aygit.model}" itemValue="#{aygit}"/>
				<p:column>  
    	    		#{a.marka} - #{a.model}
        	    </p:column>
        		<p:ajax update="yazilim" listener="#{MusteriAygitlariBean.handleAygitChange}" />
			</p:selectOneMenu>
								
			<h:outputLabel value="Seri no : " />
			<p:inputText value="#{MusteriAygitlariBean.selectedMusAygit.aygitSeriNo}" />
							
			<h:outputLabel value="Aygıt yazılımı : " />
			<p:selectOneMenu id="yazilim" value="#{AygitYazilimlariBean.selectedAygitYzl}"
			 		converter="AygitYazilimConverter" var="ay">
				<f:selectItem itemLabel="Select Software" itemValue="" />
				<f:selectItems value="#{AygitYazilimlariBean.aygitYazilimList}" 
					var="yzl" itemLabel="#{yzl.versiyonNo}" itemValue="#{yzl}"/>
				<p:column>  
    	    		#{yzl.aygit.model} - #{yzl.versiyonNo}
        		</p:column>
			</p:selectOneMenu>
		</h:panelGrid>

		<p:separator />
		<p:commandButton value="Submit" update=":musteriUrunForm"
				action="#{MusteriAygitlariBean.SaveOrUpdate}" id="btnSubmit" />
	</p:panel>
</ui:composition>